The present invention relates to data processing systems, and more particularly, to determining the contents of a Java Repository containing Java Beans.
Over the past few years, constructing applications by assembling reusable software components has emerged as a highly productive and widely accepted way to develop custom applications. First generation products such as Microsoft""s Visual Basic and Borland""s Delphi, have been followed by a wave of new products which have enhanced the basic component assembly application development model by adding more powerful data access components, and object-oriented component extension capabilities. Java, manufactured by the Sun Microsystems, Inc., has quickly established itself as the industry-standard platform for building fully portable Internet and corporate Internet applets and applications. The Java platform provides a number of advantages to developers which include a fully portable platform, a powerful and compact environment, and a network aware platform. Java""s language, libraries and virtual machines occupy an ever increasing presence in browsers which allows developers to write application functionality once, and deploy the application broadly on a wide variety of operating systems and hardware platforms. The Java platform provides developers with the full power of an object-oriented language while eliminating the complexity, housekeeping and heavier weight object creation and registration processes required by other language and programming model environments. Java""s lightweight runtime is easily incorporated into chips for embedded systems, such as PDAs as well as client and server class Personal Computers (Pcs) and workstations. Security mechanisms are provided which allow full protection against applet interference with client-side data. The platform allows applets to be built from self-describing classes, which are easily downloaded to the client environment without the need for heavy weight installation or registration processes. The recent release of Sun Microsystems Inc.""s Java Beans takes the component software assembly paradigm to a new level.
Java Beans is an architecture and platform neutral Application Programming Interface (API) for creating and using dynamic Java components. Java Beans builds on the strengths of the component assembly development model. It allows developers to define independent components that can be used and re-used in a variety of combinations to compose new applications inside a variety of browser and non-browser environments. Java Beans components can be Graphical User Interface (GUI) widgets, non-visual functions and services, applets and more full-scale applications. Each of these components can be built by different developers at separate times. The components do not need to be part of the same application build but are capable of communicating dynamically.
The Java Beans API is designed for scaling up from simpler, lighter weight, widgets and applets toward more full function applications. This is in stark contrast to existing component model APIs which scale down from complex heavyweight application size components to include lighter-weight widget size components. Consequently, the Java Beans API will not overburden the smaller widget and applet size components with complexity and weight. Java Beans are frequently transmitted in Java Archive (JAR) file format which is a platform-independent file format that aggregates many files into one. Multiple Java applets and their requisite components (.class files, images, sounds and other data) are bundled in a JAR file and subsequently downloaded to a browser in a single HyperText Transfer Protocol (HTTP) transaction, which greatly improves the download speed. The JAR format also supports compression, which reduces the file size, further improving the download time.
In development environments, JAR files are frequently received containing a plurality of Java Beans with minimal or no information about the Java Beans within the JAR file. The technique for determining the contents of these JAR file requires an introspection step followed by instantiation of each Java Bean. Introspection is the process that Java uses to discover the properties, methods and events of a component. The introspection step is followed by creating an instance of each Java Bean. These steps require significant execution time and thus reduce the efficiency of programmers.
Consequently, it would be desirable to provide a method and apparatus for determining the contents of a Java Archive file without requiring introspection and instantiation of the Java Beans stored therein.
This invention relates to a method and apparatus for determining the names of Java Beans and for categorizing Java Bean sub-element files. A two stage process is disclosed for Java files having one or more class files and ser (serialized) files. The first stage attempts to determine the name of a Java Bean based upon the file names forming the Bean. Each file name is first analyzed to determine if it ends with a .ser, .class, .java, .gif, or .jpg suffix. If a particular suffix is found, the file name undergoes an additional examination for a string equaled to xe2x80x9cExceptionxe2x80x9d, xe2x80x9cCustomizerxe2x80x9d, xe2x80x9cBeanxe2x80x9d, xe2x80x9cBeanInfoxe2x80x9d or xe2x80x9cIconxe2x80x9d. The first stage produces a determination of each of the Java file names. The second stage is then applied to determine the category of the Bean sub-elements using the name of the Java Bean derived in the first stage. The first stage names are again examined for the .class, .ser, .java, .gif, or .jpg suffixes. After determining the proper suffix, the names are again searched for the strings xe2x80x9cExceptionxe2x80x9d, xe2x80x9cCustomizerxe2x80x9d, xe2x80x9cBeanxe2x80x9d, xe2x80x9cBeanInfoxe2x80x9d, etc. to determine the category for the sub-element file.